import React from "react";
import { useParams, useMatch } from "react-router-dom";

export default function Detail() {
    // 接收params参数
    const { title, content } = useParams();

    // 使用useMatch() hook时需要传入全路由path
    const x = useMatch("/home/message/detail/:id/:title/:content");
    console.log(x);

    return (
        <div>
            <h4>{title}</h4>
            <div>{content}</div>
        </div>
    );
}
